<?php
$params = array_merge(
    require(__DIR__ . '/../../common/config/params.php'),
    require(__DIR__ . '/../../common/config/params-local.php'),
    require(__DIR__ . '/params.php'),
    require(__DIR__ . '/params-local.php')
);

return [
    'id' => 'app-frontend',
    'basePath' => dirname(__DIR__),
    'bootstrap' => ['log'],
    'controllerNamespace' => 'frontend\controllers',
 
    'components' => [    
        'request' => [
            'csrfParam' => '_csrf-frontend',
        ],
        'user' => [
            'identityClass' => 'common\models\User',
            'enableAutoLogin' => true,
            'identityCookie' => ['name' => '_identity-frontend', 'httpOnly' => true],
        ],
        'session' => [
            // this is the name of the session cookie used for login on the frontend
            'name' => 'advanced-frontend',
        ],
        'log' => [
            'traceLevel' => YII_DEBUG ? 3 : 0,
            'targets' => [
                [
                    'class' => 'yii\log\FileTarget',
                    'levels' => ['error', 'warning'],
                ],
            ],
        ],
        'errorHandler' => [
            'errorAction' => 'site/error',
        ],
        
        
//        'urlManager'=>[
//            'class' => 'yii\web\UrlManager',
//            'enablePrettyUrl' => true,
//            'showScriptName' => true,
//            'rules'=>[
//                '<controller:(post|comment)>/<id:\d+>/<action:(create|update|delete)>' =>'<controller>/<action>',
//                '<controller:(post|comment)>/<id:\d+>' => '<controller>/read',
//                '<controller:(post|comment)>s' => '<controller>/list',
//                     ],
//             ],
//        
        //使用默认主题 
        'view' =>[
              'theme' =>[
                  'pathMap' => ['@app/views'=>'@app/views/default'],
                  'baseUrl' => '@web/views/default',
              ],
          ],
        
        //因为前台 不须要使用yii内置的 yii.js ,bootstrap, jquery，关于jquery 我们在用到时 手动加载
        //这样方便我们更自由地使用 资源，及选定对应版本，而不是由yii2内部去管理 
        'assetManager' => [
            
            'bundles' => [
                
//                'yii\web\YiiAsset' => [
//                    'js' => [],  // 去除 yii.js
//                    'sourcePath' => null,  // 防止在 frontend/web/asset 下生产文件
//                ],
//
//                'yii\widgets\ActiveFormAsset' => [
//                    'js' => [],  // 去除 yii.activeForm.js
//                    'sourcePath' => null,  // 防止在 frontend/web/asset 下生产文件
//                ],
//
//                'yii\validators\ValidationAsset' => [
//                    'js' => [],  // 去除 yii.validation.js
//                    'sourcePath' => null,  // 防止在 frontend/web/asset 下生产文件
//                ],
//                
                
                'yii\web\JqueryAsset' => [
                    'js' => [],  // 去除 jquery.js
                    'sourcePath' => null,  // 防止在 frontend/web/asset 下生产文件
                ],


                 'yii\bootstrap\BootstrapAsset' => [
                 'css' => [],  // 去除 bootstrap.css
                 'sourcePath' => null, // 防止在 frontend/web/asset 下生产文件
                ],
                
                'yii\bootstrap\BootstrapPluginAsset' => [
                    'js' => [],  // 去除 bootstrap.js
                    'sourcePath' => null,  // 防止在 frontend/web/asset 下生产文件
                ],
                
                
            ],
           ],
        
   


     ],

    
       'as behavior' => [
            'class' => 'frontend\components\PreBehavior',
        ],
  


    'params' => $params,
];
